import path from "path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
console.log(import.meta.url);
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base: "./",
  server: {
    host: "0.0.0.0",
    // proxy: {
    //   // 选项写法
    //   "/api": {
    //     target: "http://localhost:3000", // 代理到的目标地址
    //     changeOrigin: true, // 是否改变请求源
    //   },
    // },
  },
  build: {
    assetsInclude: ["**/*.JPG", "**/*.jpg"],
    outDir: "dist",
    terserOptions: {
      compress: {
        keep_infinity: true,
        // 删除console
        drop_console: true,
      },
    },
    // 禁用该功能可能会提高大型项目的构建性能
    brotliSize: false,
    assetsDir: "assets",
  },

  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
});
